package com.sping_boot3.spirng_boot3.juc;

public class Ticket {
    private int number  = 20;
    public synchronized void sale(){
        if(number >0 ){
            number--;
            System.out.println(Thread.currentThread()+"买出一张:"+"剩余"+number);
        }
    }
}
